#include <stdio.h>
#define CHECK(x, y, n) x >= 0 && y >= 0 && x < n && y < n
#define MEDIAN(x, y, z) x > y ? (y > z ? y : (x > z ? z : x)) : (x > z ? x : (y > z ? z : y))
#define POLYNOMIAL(x) 3*x*x*x*x*x + 2*x*x*x*x - 5*x*x*x - x*x + 7*x -6
int main(void)
{
    printf("%d\n", CHECK(1, 2, 3));
    printf("%d\n", CHECK(0, 2, 3));
    printf("%d\n", CHECK(-1, 2, 3));
    printf("%d\n", CHECK(1, 20, 3));

    printf("%d\n", MEDIAN(1, 2, 3));
    printf("%d\n", MEDIAN(1, 3, 2));
    printf("%d\n", MEDIAN(2, 1, 3));
    printf("%d\n", MEDIAN(2, 3, 1));
    printf("%d\n", MEDIAN(3, 1, 2));
    printf("%d\n", MEDIAN(3, 2, 1));

    printf("%d\n", POLYNOMIAL(1));
    printf("%d\n", POLYNOMIAL(2));
    return 0;
}